<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<jsp:include page="../frame/header.jsp"></jsp:include>

<title>反馈列表</title>

<style>
.pagination .active a {
	/*background-color: #CC0041;
	color:white;*/
}
</style>

</head>

<body>

	<div class="container-fluid">
		<div id="market" class="row-fluid">
			<div>
				<ul class="breadcrumb">
					<li><a href="#">系统管理</a> <span class="divider">/</span></li>
					<li><a href="#">反馈列表</a></li>
				</ul>
			</div>

			<div class="box">
				<div class="box-header well" data-original-title>
					<h2>
						<i class="icon-th"></i> 反馈信息列表
					</h2>

					<div class="box-icon">
						<a href="#" class="btn btn-setting btn-round"><i
							class="icon-cog"></i></a> <a href="#"
							class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
						<a href="#" class="btn btn-close btn-round"><i
							class="icon-remove"></i></a>
					</div>
				</div>
				<div class="box-content">
					<form id="searchForm" method="post" class="form-search span12" action="<c:url value="/admin/more/feedback/search"/>">
						<input type="hidden" name="pageNum" id="pageNum" value="${searchForm.pageNum }">
						<input type="hidden" name="infoId" id="infoId" value="0">
					</form>
					<table id="userInfo" class="table table-striped table-bordered ">
						<thead>
							<tr>
								<th width="30">序号</th>
								<th>姓名</th>
								<th>手机</th>
								<th>邮箱</th>
								<th>反馈时间</th>
								
							</tr>
						</thead>
						<tbody>
							<c:forEach var="fb" items="${pageModel.result }" varStatus="status">
								<tr>
									<td>${status.index+1 }</td>
									<td>${fb.name }</td>
									<td>${fb.phone } </td>
									<td>${fb.email } </td>
									<td>${fb.createTime } </td>
									<td>
										<a href="javascript:view('${fb.feedbackId }')">查看</a>&nbsp;&nbsp; 
										<a href="javascript:del('${fb.feedbackId }')">删除</a>&nbsp;&nbsp; 
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					
					<div id="mypager" class="mypager"></div>
				</div>
			</div>
		</div>
		<!--/fluid-row-->

	</div>
	<!--/.fluid-container-->

	<jsp:include page="../frame/scripts.jsp"></jsp:include>
	<script type="text/javascript">
	
	var pageNum = "${pageModel.pageNum}";
	var totalPage = "${pageModel.totalPage}";
	var numPerPage = "${pageModel.numPerPage}";
	
	$(document).ready(function(){
		
		$('#mypager').bootstrapPaginator({
			currentPage:pageNum,
			totalPages:totalPage,
			numberOfPages:numPerPage,
			onPageClicked:function(event, originalEvent, type,page){
				$("input[name='pageNum']").val(page);
				$("#searchForm").submit();
			}
		});

	})
	
	function view(messageId){
		window.location.href = '<c:url value="/admin/more/viewFeedback?feedbackId='+messageId+'"/>';
	}
	
	function del(messageId){
		if(confirm("确定要删除吗？")){
			$("input[name='infoId']").val(messageId);
			$("#searchForm").submit();
		}
	}
	
	</script>
</body>
</html>
